package com.fg.cloud.factory.controller.order;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fg.cloud.common.PageParamUtil;
import com.fg.cloud.common.PageUtils;
import com.fg.cloud.framework.controller.BaseController;
import com.fg.cloud.manager.entry.order.OrderDetailEntity;
import com.fg.cloud.manager.service.order.OrderDetailService;

/**
 * @author ：
 * @date   ： 2017年6月21日 下午5:36:48
 * @Desc   ：订单明细controller
 */
@Controller
@RequestMapping(value="/orderdetail")
public class OrderDetailController extends BaseController {

	@Autowired
	private OrderDetailService orderDetailService;
	/**
	 * 获取订单明细列表
	 * @param request
	 * @param response
	 */
	@RequestMapping(value = "/select", method = RequestMethod.GET)
	@ResponseBody
	public void select(HttpServletRequest request, HttpServletResponse response, 
			OrderDetailEntity orderDetailEntity) {
		try {
			Map<String, Object> param = PageParamUtil.pageParam(request, "id", "orderId");
			PageUtils<OrderDetailEntity> page = orderDetailService.selectPage(param);
			doResult(response, true, page, "成功");
		} catch (Exception e) {
			e.printStackTrace();
			doResult(response, false, null, e.getMessage());
		}
	}
	
	
}
